/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  @endpointMap = {
    ap-northeast-1 = 'dataworks.ap-northeast-1.aliyuncs.com',
    ap-south-1 = 'dataworks.ap-south-1.aliyuncs.com',
    ap-southeast-1 = 'dataworks.ap-southeast-1.aliyuncs.com',
    ap-southeast-2 = 'dataworks.ap-southeast-2.aliyuncs.com',
    ap-southeast-3 = 'dataworks.ap-southeast-3.aliyuncs.com',
    ap-southeast-5 = 'dataworks.ap-southeast-5.aliyuncs.com',
    cn-beijing = 'dataworks.cn-beijing.aliyuncs.com',
    cn-chengdu = 'dataworks.cn-chengdu.aliyuncs.com',
    cn-hangzhou = 'dataworks.cn-hangzhou.aliyuncs.com',
    cn-hongkong = 'dataworks.cn-hongkong.aliyuncs.com',
    cn-huhehaote = 'dataworks.aliyuncs.com',
    cn-qingdao = 'dataworks.aliyuncs.com',
    cn-shanghai = 'dataworks.cn-shanghai.aliyuncs.com',
    cn-shenzhen = 'dataworks.cn-shenzhen.aliyuncs.com',
    cn-zhangjiakou = 'dataworks.aliyuncs.com',
    eu-central-1 = 'dataworks.eu-central-1.aliyuncs.com',
    eu-west-1 = 'dataworks.eu-west-1.aliyuncs.com',
    me-east-1 = 'dataworks.me-east-1.aliyuncs.com',
    us-east-1 = 'dataworks.us-east-1.aliyuncs.com',
    us-west-1 = 'dataworks.us-west-1.aliyuncs.com',
    cn-hangzhou-finance = 'dataworks.aliyuncs.com',
    cn-shenzhen-finance-1 = 'dataworks.aliyuncs.com',
    cn-shanghai-finance-1 = 'dataworks.aliyuncs.com',
    cn-north-2-gov-1 = 'dataworks.aliyuncs.com',
  };

  checkConfig(config);
  @endpoint = getEndpoint('dataworks-public', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CreateManualDagRequest {
  bizdate?: string(name='Bizdate', description='This parameter is required.', example='2018-12-12 00:00:00'),
  dagPara?: string(name='DagPara', example='param_k1=param_v1 param_k2=param_v2'),
  flowName?: string(name='FlowName', description='This parameter is required.', example='test_flow'),
  nodePara?: string(name='NodePara', example='{"103180025": "test=$[yyyy-mm-dd]"}'),
  projectName?: string(name='ProjectName', description='This parameter is required.', example='test_project'),
}

model CreateManualDagResponseBody = {
  requestId?: string(name='RequestId', example='2d9ce-38ef-4923-baf6-391a7e656'),
  returnCode?: string(name='ReturnCode', example='0'),
  returnErrorSolution?: string(name='ReturnErrorSolution', example='test'),
  returnMessage?: string(name='ReturnMessage', example='test'),
  returnValue?: long(name='ReturnValue', example='1244311235'),
}

model CreateManualDagResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateManualDagResponseBody(name='body'),
}

/**
 * @param request CreateManualDagRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateManualDagResponse
 */
async function createManualDagWithOptions(request: CreateManualDagRequest, runtime: Util.RuntimeOptions): CreateManualDagResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.bizdate)) {
    query['Bizdate'] = request.bizdate;
  }
  if (!Util.isUnset(request.dagPara)) {
    query['DagPara'] = request.dagPara;
  }
  if (!Util.isUnset(request.flowName)) {
    query['FlowName'] = request.flowName;
  }
  if (!Util.isUnset(request.nodePara)) {
    query['NodePara'] = request.nodePara;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateManualDag',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request CreateManualDagRequest
 * @return CreateManualDagResponse
 */
async function createManualDag(request: CreateManualDagRequest): CreateManualDagResponse {
  var runtime = new Util.RuntimeOptions{};
  return createManualDagWithOptions(request, runtime);
}

model DeleteFileRequest {
  fileId?: long(name='FileId', description='This parameter is required.'),
  projectId?: long(name='ProjectId'),
  projectIdentifier?: string(name='ProjectIdentifier'),
}

model DeleteFileResponseBody = {
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model DeleteFileResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFileResponseBody(name='body'),
}

/**
 * @param request DeleteFileRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFileResponse
 */
async function deleteFileWithOptions(request: DeleteFileRequest, runtime: Util.RuntimeOptions): DeleteFileResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.fileId)) {
    body['FileId'] = request.fileId;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.projectIdentifier)) {
    body['ProjectIdentifier'] = request.projectIdentifier;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteFile',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DeleteFileRequest
 * @return DeleteFileResponse
 */
async function deleteFile(request: DeleteFileRequest): DeleteFileResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteFileWithOptions(request, runtime);
}

model DescribeEmrHiveTableRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='C-D033DD5FB82436A6'),
  databaseName?: string(name='DatabaseName', description='This parameter is required.', example='default'),
  tableName?: string(name='TableName', example='pt_table_090901_emr'),
}

model DescribeEmrHiveTableResponseBody = {
  data?: {
    clusterBizId?: string(name='ClusterBizId', example='C-D033DD5FB82436A6'),
    clusterBizName?: string(name='ClusterBizName'),
    columns?: [ 
      {
        columnComment?: string(name='ColumnComment', example='BALANCE FIELD'),
        columnName?: string(name='ColumnName', example='double'),
        columnPosition?: int32(name='ColumnPosition', example='1'),
        columnType?: string(name='ColumnType', example='double'),
        comment?: string(name='Comment', example='BALANCE FIELD'),
        gmtCreate?: string(name='GmtCreate', example='2019-09-09 20:23:47'),
        gmtModified?: string(name='GmtModified', example='2019-09-09 20:23:47'),
      }
    ](name='Columns'),
    databaseName?: string(name='DatabaseName', example='default'),
    gmtCreate?: string(name='GmtCreate', example='2019-09-09 20:41:28'),
    gmtModified?: string(name='GmtModified', example='2019-09-09 20:41:28'),
    inputFormat?: string(name='InputFormat', example='org.apache.hadoop.mapred.TextInputFormat'),
    isCompressed?: boolean(name='IsCompressed', example='false'),
    isTemporary?: boolean(name='IsTemporary', example='false'),
    lastAccessTime?: string(name='LastAccessTime', example='1970-01-01 08:00:00'),
    lastModifyTime?: string(name='LastModifyTime', example='2019-09-09 20:23:47'),
    location?: string(name='Location', example='hdfs://emr-header-1.cluster-136574:9000/user/hive/warehouse/pt_table_090901_emr'),
    outputFormat?: string(name='OutputFormat', example='org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'),
    owner?: string(name='Owner', example='root'),
    ownerId?: string(name='OwnerId', example='1861276710322536'),
    ownerType?: string(name='OwnerType', example='USER'),
    partitionKeys?: string(name='PartitionKeys', example='DS,HR,REGION'),
    serializationLib?: string(name='SerializationLib', example='org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'),
    tableComment?: string(name='TableComment', example='RANDOM GENERATED TEST DATA BY FUNCTION OF RANDOM_TEST_DATA'),
    tableDesc?: string(name='TableDesc', example='RANDOM GENERATED TEST DATA BY FUNCTION OF RANDOM_TEST_DATA'),
    tableName?: string(name='TableName', example='pt_table_090901_emr'),
    tableParameters?: string(name='TableParameters', example='{\\\\"transient_lastDdlTime\\\\":\\\\"1568031823\\\\",\\\\"bucketing_version\\\\":\\\\"2\\\\",\\\\"comment\\\\":\\\\"RANDOM GENERATED TEST DATA BY FUNCTION OF RANDOM_TEST_DATA\\\\"}'),
    tableSize?: long(name='TableSize', example='552'),
    tableType?: string(name='TableType', example='MANAGED_TABLE'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode', example='0'),
  errorMessage?: string(name='ErrorMessage', example='test'),
  requestId?: string(name='RequestId', example='E6F0DBDD-5AD8-4870-A6A0'),
}

model DescribeEmrHiveTableResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DescribeEmrHiveTableResponseBody(name='body'),
}

/**
 * @param request DescribeEmrHiveTableRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DescribeEmrHiveTableResponse
 */
async function describeEmrHiveTableWithOptions(request: DescribeEmrHiveTableRequest, runtime: Util.RuntimeOptions): DescribeEmrHiveTableResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeEmrHiveTable',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request DescribeEmrHiveTableRequest
 * @return DescribeEmrHiveTableResponse
 */
async function describeEmrHiveTable(request: DescribeEmrHiveTableRequest): DescribeEmrHiveTableResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeEmrHiveTableWithOptions(request, runtime);
}

model GetDataServiceApiAuthMapContextRequest {
  apiId?: long(name='ApiId', description='API ID', example='1'),
  apiPath?: string(name='ApiPath', example='/apiPath'),
  projectId?: long(name='ProjectId', example='1'),
  verbose?: boolean(name='Verbose', example='true'),
}

model GetDataServiceApiAuthMapContextResponseBody = {
  data?: string(name='Data', example='{}'),
  errCode?: string(name='ErrCode', example='0'),
  errMsg?: string(name='ErrMsg', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='123-abc'),
}

model GetDataServiceApiAuthMapContextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDataServiceApiAuthMapContextResponseBody(name='body'),
}

/**
 * @summary 新server独享资源组获取api context
 *
 * @param request GetDataServiceApiAuthMapContextRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDataServiceApiAuthMapContextResponse
 */
async function getDataServiceApiAuthMapContextWithOptions(request: GetDataServiceApiAuthMapContextRequest, runtime: Util.RuntimeOptions): GetDataServiceApiAuthMapContextResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDataServiceApiAuthMapContext',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新server独享资源组获取api context
 *
 * @param request GetDataServiceApiAuthMapContextRequest
 * @return GetDataServiceApiAuthMapContextResponse
 */
async function getDataServiceApiAuthMapContext(request: GetDataServiceApiAuthMapContextRequest): GetDataServiceApiAuthMapContextResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDataServiceApiAuthMapContextWithOptions(request, runtime);
}

model GetDataServiceApiContextRequest {
  apiId?: long(name='ApiId', description='apiId

This parameter is required.', example='12345'),
  apiStatus?: int32(name='ApiStatus', example='1'),
  cacheKey?: string(name='CacheKey', example='abc-124'),
  forPrivateResGroup?: boolean(name='ForPrivateResGroup', example='true'),
  verbose?: boolean(name='Verbose', example='true'),
}

model GetDataServiceApiContextResponseBody = {
  data?: string(name='Data', example='{"apiId":123}'),
  errCode?: string(name='ErrCode', example='0'),
  errMsg?: string(name='ErrMsg', example='success'),
  requestId?: string(name='RequestId', example='1AFAE64E-D1BE-432B-A9****'),
}

model GetDataServiceApiContextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDataServiceApiContextResponseBody(name='body'),
}

/**
 * @summary 查询apiContext接口
 *
 * @param request GetDataServiceApiContextRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDataServiceApiContextResponse
 */
async function getDataServiceApiContextWithOptions(request: GetDataServiceApiContextRequest, runtime: Util.RuntimeOptions): GetDataServiceApiContextResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDataServiceApiContext',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询apiContext接口
 *
 * @param request GetDataServiceApiContextRequest
 * @return GetDataServiceApiContextResponse
 */
async function getDataServiceApiContext(request: GetDataServiceApiContextRequest): GetDataServiceApiContextResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDataServiceApiContextWithOptions(request, runtime);
}

model GetDataServiceConnectionRequest {
  connectionId?: long(name='ConnectionId', example='1'),
  dataSourceType?: string(name='DataSourceType', example='normal'),
}

model GetDataServiceConnectionResponseBody = {
  data?: string(name='Data', example='{}'),
  errCode?: string(name='ErrCode', example='0'),
  errMsg?: string(name='ErrMsg', example='success'),
  requestId?: string(name='RequestId', description='Id of the request', example='123-abc'),
}

model GetDataServiceConnectionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDataServiceConnectionResponseBody(name='body'),
}

/**
 * @summary 新server独享资源组获取数据源信息
 *
 * @param request GetDataServiceConnectionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDataServiceConnectionResponse
 */
async function getDataServiceConnectionWithOptions(request: GetDataServiceConnectionRequest, runtime: Util.RuntimeOptions): GetDataServiceConnectionResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDataServiceConnection',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 新server独享资源组获取数据源信息
 *
 * @param request GetDataServiceConnectionRequest
 * @return GetDataServiceConnectionResponse
 */
async function getDataServiceConnection(request: GetDataServiceConnectionRequest): GetDataServiceConnectionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDataServiceConnectionWithOptions(request, runtime);
}

model GetDataServiceContextUpdateEventResponseBody = {
  data?: string(name='Data', example='{\\\\"TotalCount\\\\": 0, \\\\"CalcEngines\\\\": []}'),
  errCode?: string(name='ErrCode', example='0'),
  errMsg?: string(name='ErrMsg', example='success'),
  requestId?: string(name='RequestId', example='8754EE08-4AA2-5F77-ADD7-754DBBDA9F75'),
}

model GetDataServiceContextUpdateEventResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDataServiceContextUpdateEventResponseBody(name='body'),
}

/**
 * @summary 查询apiContext更新事件接口
 *
 * @param request GetDataServiceContextUpdateEventRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDataServiceContextUpdateEventResponse
 */
async function getDataServiceContextUpdateEventWithOptions(runtime: Util.RuntimeOptions): GetDataServiceContextUpdateEventResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'GetDataServiceContextUpdateEvent',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询apiContext更新事件接口
 *
 * @return GetDataServiceContextUpdateEventResponse
 */
async function getDataServiceContextUpdateEvent(): GetDataServiceContextUpdateEventResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDataServiceContextUpdateEventWithOptions(runtime);
}

model GetDataServiceFunctionRequest {
  functionId?: long(name='FunctionId'),
}

model GetDataServiceFunctionResponseBody = {
  data?: string(name='Data', description='Id of the request'),
  errCode?: string(name='ErrCode'),
  errMsg?: string(name='ErrMsg'),
  requestId?: string(name='RequestId'),
}

model GetDataServiceFunctionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetDataServiceFunctionResponseBody(name='body'),
}

/**
 * @summary 查询函数信息
 *
 * @param request GetDataServiceFunctionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetDataServiceFunctionResponse
 */
async function getDataServiceFunctionWithOptions(request: GetDataServiceFunctionRequest, runtime: Util.RuntimeOptions): GetDataServiceFunctionResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetDataServiceFunction',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询函数信息
 *
 * @param request GetDataServiceFunctionRequest
 * @return GetDataServiceFunctionResponse
 */
async function getDataServiceFunction(request: GetDataServiceFunctionRequest): GetDataServiceFunctionResponse {
  var runtime = new Util.RuntimeOptions{};
  return getDataServiceFunctionWithOptions(request, runtime);
}

model GetSwitchValueRequest {
  switchName?: string(name='SwitchName'),
}

model GetSwitchValueResponseBody = {
  data?: string(name='Data'),
  requestId?: string(name='RequestId'),
}

model GetSwitchValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetSwitchValueResponseBody(name='body'),
}

/**
 * @summary 根据Switch名称获取值
 *
 * @param request GetSwitchValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetSwitchValueResponse
 */
async function getSwitchValueWithOptions(request: GetSwitchValueRequest, runtime: Util.RuntimeOptions): GetSwitchValueResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.switchName)) {
    query['SwitchName'] = request.switchName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetSwitchValue',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 根据Switch名称获取值
 *
 * @param request GetSwitchValueRequest
 * @return GetSwitchValueResponse
 */
async function getSwitchValue(request: GetSwitchValueRequest): GetSwitchValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return getSwitchValueWithOptions(request, runtime);
}

model GetTimeMachineTaskRequest {
  taskId?: string(name='TaskId'),
}

model GetTimeMachineTaskResponseBody = {
  data?: {
    gmtCreate?: string(name='GmtCreate'),
    gmtModified?: string(name='GmtModified'),
    hostName?: string(name='HostName'),
    id?: string(name='Id'),
    objId?: string(name='ObjId'),
    objName?: string(name='ObjName'),
    operType?: string(name='OperType'),
    status?: string(name='Status'),
  }(name='Data'),
  errCode?: string(name='ErrCode'),
  errMsg?: string(name='ErrMsg'),
  requestId?: string(name='RequestId'),
}

model GetTimeMachineTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetTimeMachineTaskResponseBody(name='body'),
}

/**
 * @summary 查询timeMachine任务详情
 *
 * @param request GetTimeMachineTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetTimeMachineTaskResponse
 */
async function getTimeMachineTaskWithOptions(request: GetTimeMachineTaskRequest, runtime: Util.RuntimeOptions): GetTimeMachineTaskResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.taskId)) {
    query['TaskId'] = request.taskId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetTimeMachineTask',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询timeMachine任务详情
 *
 * @param request GetTimeMachineTaskRequest
 * @return GetTimeMachineTaskResponse
 */
async function getTimeMachineTask(request: GetTimeMachineTaskRequest): GetTimeMachineTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return getTimeMachineTaskWithOptions(request, runtime);
}

model ListEmrHiveAuditLogsRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='C-D033DD5FB82436A6'),
  databaseName?: string(name='DatabaseName', description='This parameter is required.', example='default'),
  endTime?: int32(name='EndTime', example='1586509710'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='2'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='2'),
  startTime?: int32(name='StartTime', example='1586509407'),
  tableName?: string(name='TableName', description='This parameter is required.', example='test_table'),
}

model ListEmrHiveAuditLogsResponseBody = {
  data?: {
    pageNumber?: int32(name='PageNumber', example='2'),
    pageSize?: int32(name='PageSize', example='2'),
    pagedData?: [ 
      {
        database?: string(name='Database', example='default'),
        eventTime?: long(name='EventTime', example='1564019679506'),
        groups?: [ string ](name='Groups'),
        operation?: string(name='Operation', example='CREATE_TABLE'),
        table?: string(name='Table', example='test_table'),
        user?: string(name='User', example='root'),
      }
    ](name='PagedData'),
    totalCount?: int32(name='TotalCount', example='5'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode', example='0'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='58D5334A-B013-430E'),
}

model ListEmrHiveAuditLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEmrHiveAuditLogsResponseBody(name='body'),
}

/**
 * @param request ListEmrHiveAuditLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEmrHiveAuditLogsResponse
 */
async function listEmrHiveAuditLogsWithOptions(request: ListEmrHiveAuditLogsRequest, runtime: Util.RuntimeOptions): ListEmrHiveAuditLogsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEmrHiveAuditLogs',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListEmrHiveAuditLogsRequest
 * @return ListEmrHiveAuditLogsResponse
 */
async function listEmrHiveAuditLogs(request: ListEmrHiveAuditLogsRequest): ListEmrHiveAuditLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listEmrHiveAuditLogsWithOptions(request, runtime);
}

model ListEmrHiveDatabasesRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='C-D033DD5FB82436A6'),
}

model ListEmrHiveDatabasesResponseBody = {
  data?: [ 
    {
      comment?: string(name='Comment', example='Default Hive database'),
      gmtCreate?: long(name='GmtCreate', example='1568010630000'),
      gmtModified?: long(name='GmtModified', example='1568010630000'),
      location?: string(name='Location', example='hdfs://emr-header-1.cluster-136574:9000/user/hive/warehouse'),
      name?: string(name='Name', example='default'),
      owner?: string(name='Owner', example='public'),
      ownerId?: string(name='OwnerId', example='18612767'),
      ownerType?: string(name='OwnerType', example='ROLE'),
      parameters?: string(name='Parameters', example='{}'),
      region?: string(name='Region', example='cn-shanghai'),
      status?: string(name='Status', example='-'),
      type?: string(name='Type', example='HIVE'),
    }
  ](name='Data'),
  errorCode?: string(name='ErrorCode', example='0'),
  errorMessage?: string(name='ErrorMessage', example='test'),
  requestId?: string(name='RequestId', example='D9A61DC0-B922-421B-B706'),
}

model ListEmrHiveDatabasesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEmrHiveDatabasesResponseBody(name='body'),
}

/**
 * @param request ListEmrHiveDatabasesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEmrHiveDatabasesResponse
 */
async function listEmrHiveDatabasesWithOptions(request: ListEmrHiveDatabasesRequest, runtime: Util.RuntimeOptions): ListEmrHiveDatabasesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEmrHiveDatabases',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListEmrHiveDatabasesRequest
 * @return ListEmrHiveDatabasesResponse
 */
async function listEmrHiveDatabases(request: ListEmrHiveDatabasesRequest): ListEmrHiveDatabasesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listEmrHiveDatabasesWithOptions(request, runtime);
}

model ListEmrHiveTablesRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='C-D033DD5FB82436A6'),
  databaseName?: string(name='DatabaseName', description='This parameter is required.', example='default'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='2'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='2'),
}

model ListEmrHiveTablesResponseBody = {
  data?: {
    pageNumber?: int32(name='PageNumber', example='2'),
    pageSize?: int32(name='PageSize', example='2'),
    pagedData?: [ 
      {
        clusterBizId?: string(name='ClusterBizId', example='C-D033DD5FB82436A6'),
        clusterBizName?: string(name='ClusterBizName'),
        databaseName?: string(name='DatabaseName', example='default'),
        gmtCreate?: string(name='GmtCreate', example='2019-09-09 20:23:47'),
        gmtModified?: string(name='GmtModified', example='2019-09-09 20:23:47'),
        inputFormat?: string(name='InputFormat', example='org.apache.hadoop.hive.ql.io.orc.OrcInputFormat'),
        isCompressed?: boolean(name='IsCompressed', example='false'),
        isTemporary?: boolean(name='IsTemporary', example='false'),
        lastAccessTime?: string(name='LastAccessTime', example='1970-01-01 08:00:00'),
        lastModifyTime?: string(name='LastModifyTime', example='2019-09-09 20:23:47'),
        location?: string(name='Location', example='hdfs://emr-header-1.cluster-136574:9000/user/hive/warehouse/pt_table_090901_emr'),
        outputFormat?: string(name='OutputFormat', example='org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'),
        owner?: string(name='Owner', example='root'),
        ownerId?: string(name='OwnerId', example='18612767103****'),
        ownerType?: string(name='OwnerType', example='ROLE'),
        partitionKeys?: string(name='PartitionKeys', example='DS,HR,REGION'),
        serializationLib?: string(name='SerializationLib', example='org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe'),
        tableComment?: string(name='TableComment', example='RANDOM GENERATED TEST DATA BY FUNCTION OF RANDOM_TEST_DATA'),
        tableDesc?: string(name='TableDesc', example='RANDOM GENERATED TEST DATA BY FUNCTION OF RANDOM_TEST_DATA'),
        tableName?: string(name='TableName', example='pt_table_090901_emr_orc'),
        tableParameters?: string(name='TableParameters', example='{\\\\"transient_lastDdlTime\\\\":\\\\"1568031823\\\\",\\\\"bucketing_version\\\\":\\\\"2\\\\",\\\\"comment\\\\":\\\\"RANDOM GENERATED TEST DATA BY FUNCTION OF RANDOM_TEST_DATA\\\\"}'),
        tableType?: string(name='TableType', example='MANAGED_TABLE'),
      }
    ](name='PagedData'),
    totalCount?: int32(name='TotalCount', example='5'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode', example='0'),
  errorMessage?: string(name='ErrorMessage', example='test'),
  requestId?: string(name='RequestId', example='E6F0DBDD-5AD8-4870-A6A0'),
}

model ListEmrHiveTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListEmrHiveTablesResponseBody(name='body'),
}

/**
 * @param request ListEmrHiveTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListEmrHiveTablesResponse
 */
async function listEmrHiveTablesWithOptions(request: ListEmrHiveTablesRequest, runtime: Util.RuntimeOptions): ListEmrHiveTablesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListEmrHiveTables',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListEmrHiveTablesRequest
 * @return ListEmrHiveTablesResponse
 */
async function listEmrHiveTables(request: ListEmrHiveTablesRequest): ListEmrHiveTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listEmrHiveTablesWithOptions(request, runtime);
}

model ListGovernanceIssueDataServiceAPIsRequest {
  bizDate?: string(name='BizDate'),
  ownerId?: string(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  projectId?: long(name='ProjectId', description='This parameter is required.'),
  ruleCategory?: string(name='RuleCategory', description='This parameter is required.'),
  ruleId?: string(name='RuleId'),
}

model ListGovernanceIssueDataServiceAPIsResponseBody = {
  data?: {
    APIs?: [ 
      {
        apiId?: string(name='ApiId'),
        apiName?: string(name='ApiName'),
        bizDate?: string(name='BizDate'),
        ownerId?: string(name='OwnerId'),
        projectId?: long(name='ProjectId'),
        properties?: string(name='Properties'),
        ruleCategory?: string(name='RuleCategory'),
        ruleId?: string(name='RuleId'),
      }
    ](name='APIs'),
    pageNumber?: int32(name='PageNumber'),
    pageSize?: int32(name='PageSize'),
    totalCount?: int32(name='TotalCount'),
  }(name='Data'),
  dynamicErrorCode?: string(name='DynamicErrorCode'),
  dynamicErrorMessage?: string(name='DynamicErrorMessage'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGovernanceIssueDataServiceAPIsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGovernanceIssueDataServiceAPIsResponseBody(name='body'),
}

/**
 * @summary 查询数据服务API
 *
 * @param request ListGovernanceIssueDataServiceAPIsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGovernanceIssueDataServiceAPIsResponse
 */
async function listGovernanceIssueDataServiceAPIsWithOptions(request: ListGovernanceIssueDataServiceAPIsRequest, runtime: Util.RuntimeOptions): ListGovernanceIssueDataServiceAPIsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizDate)) {
    body['BizDate'] = request.bizDate;
  }
  if (!Util.isUnset(request.ownerId)) {
    body['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.ruleCategory)) {
    body['RuleCategory'] = request.ruleCategory;
  }
  if (!Util.isUnset(request.ruleId)) {
    body['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListGovernanceIssueDataServiceAPIs',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询数据服务API
 *
 * @param request ListGovernanceIssueDataServiceAPIsRequest
 * @return ListGovernanceIssueDataServiceAPIsResponse
 */
async function listGovernanceIssueDataServiceAPIs(request: ListGovernanceIssueDataServiceAPIsRequest): ListGovernanceIssueDataServiceAPIsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGovernanceIssueDataServiceAPIsWithOptions(request, runtime);
}

model ListGovernanceIssueTablesRequest {
  bizDate?: string(name='BizDate'),
  ownerId?: string(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  projectId?: long(name='ProjectId', description='This parameter is required.'),
  ruleCategory?: string(name='RuleCategory', description='This parameter is required.'),
  ruleId?: string(name='RuleId'),
}

model ListGovernanceIssueTablesResponseBody = {
  data?: {
    pageNumber?: int32(name='PageNumber'),
    pageSize?: int32(name='PageSize'),
    tables?: [ 
      {
        bizDate?: string(name='BizDate'),
        clusterId?: string(name='ClusterId'),
        createTime?: long(name='CreateTime'),
        databaseName?: string(name='DatabaseName'),
        datasourceType?: string(name='DatasourceType'),
        downstreamDependencyCount?: int32(name='DownstreamDependencyCount'),
        lastAccessTime?: long(name='LastAccessTime'),
        lifeCycle?: long(name='LifeCycle'),
        mcProjectName?: string(name='McProjectName'),
        ownerId?: string(name='OwnerId'),
        projectId?: long(name='ProjectId'),
        properties?: string(name='Properties'),
        ruleCategory?: string(name='RuleCategory'),
        ruleId?: string(name='RuleId'),
        schema?: string(name='Schema'),
        tableGuid?: string(name='TableGuid'),
        tableName?: string(name='TableName'),
        tableSize?: long(name='TableSize'),
      }
    ](name='Tables'),
    totalCount?: int32(name='TotalCount'),
  }(name='Data'),
  dynamicErrorCode?: string(name='DynamicErrorCode'),
  dynamicErrorMessage?: string(name='DynamicErrorMessage'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGovernanceIssueTablesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGovernanceIssueTablesResponseBody(name='body'),
}

/**
 * @summary 查询治理项问题详情
 *
 * @param request ListGovernanceIssueTablesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGovernanceIssueTablesResponse
 */
async function listGovernanceIssueTablesWithOptions(request: ListGovernanceIssueTablesRequest, runtime: Util.RuntimeOptions): ListGovernanceIssueTablesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizDate)) {
    body['BizDate'] = request.bizDate;
  }
  if (!Util.isUnset(request.ownerId)) {
    body['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.ruleCategory)) {
    body['RuleCategory'] = request.ruleCategory;
  }
  if (!Util.isUnset(request.ruleId)) {
    body['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListGovernanceIssueTables',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询治理项问题详情
 *
 * @param request ListGovernanceIssueTablesRequest
 * @return ListGovernanceIssueTablesResponse
 */
async function listGovernanceIssueTables(request: ListGovernanceIssueTablesRequest): ListGovernanceIssueTablesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGovernanceIssueTablesWithOptions(request, runtime);
}

model ListGovernanceIssueTasksRequest {
  bizDate?: string(name='BizDate'),
  ownerId?: string(name='OwnerId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  projectId?: long(name='ProjectId', description='This parameter is required.'),
  ruleCategory?: string(name='RuleCategory', description='This parameter is required.'),
  ruleId?: string(name='RuleId'),
}

model ListGovernanceIssueTasksResponseBody = {
  data?: {
    pageNumber?: int32(name='PageNumber'),
    pageSize?: int32(name='PageSize'),
    tasks?: [ 
      {
        bizDate?: string(name='BizDate'),
        nodeId?: long(name='NodeId'),
        nodeName?: string(name='NodeName'),
        nodeType?: string(name='NodeType'),
        ownerId?: string(name='OwnerId'),
        projectId?: long(name='ProjectId'),
        properties?: string(name='Properties'),
        ruleCategory?: string(name='RuleCategory'),
        ruleId?: string(name='RuleId'),
      }
    ](name='Tasks'),
    totalCount?: int32(name='TotalCount'),
  }(name='Data'),
  dynamicErrorCode?: string(name='DynamicErrorCode'),
  dynamicErrorMessage?: string(name='DynamicErrorMessage'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGovernanceIssueTasksResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGovernanceIssueTasksResponseBody(name='body'),
}

/**
 * @summary 查询治理项-任务问题详情
 *
 * @param request ListGovernanceIssueTasksRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGovernanceIssueTasksResponse
 */
async function listGovernanceIssueTasksWithOptions(request: ListGovernanceIssueTasksRequest, runtime: Util.RuntimeOptions): ListGovernanceIssueTasksResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.bizDate)) {
    body['BizDate'] = request.bizDate;
  }
  if (!Util.isUnset(request.ownerId)) {
    body['OwnerId'] = request.ownerId;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.projectId)) {
    body['ProjectId'] = request.projectId;
  }
  if (!Util.isUnset(request.ruleCategory)) {
    body['RuleCategory'] = request.ruleCategory;
  }
  if (!Util.isUnset(request.ruleId)) {
    body['RuleId'] = request.ruleId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListGovernanceIssueTasks',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询治理项-任务问题详情
 *
 * @param request ListGovernanceIssueTasksRequest
 * @return ListGovernanceIssueTasksResponse
 */
async function listGovernanceIssueTasks(request: ListGovernanceIssueTasksRequest): ListGovernanceIssueTasksResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGovernanceIssueTasksWithOptions(request, runtime);
}

model ListGovernanceRulesRequest {
  category?: string(name='Category'),
  issueType?: string(name='IssueType'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model ListGovernanceRulesResponseBody = {
  data?: {
    pageNumber?: int32(name='PageNumber'),
    pageSize?: int32(name='PageSize'),
    rules?: [ 
      {
        category?: string(name='Category'),
        description?: string(name='Description'),
        guide?: string(name='Guide'),
        id?: string(name='Id'),
        issueType?: string(name='IssueType'),
        name?: string(name='Name'),
        note?: string(name='Note'),
        rule?: string(name='Rule'),
      }
    ](name='Rules'),
    totalCount?: int32(name='TotalCount'),
  }(name='Data'),
  dynamicErrorCode?: string(name='DynamicErrorCode'),
  dynamicErrorMessage?: string(name='DynamicErrorMessage'),
  errorCode?: string(name='ErrorCode'),
  errorMessage?: string(name='ErrorMessage'),
  httpStatusCode?: int32(name='HttpStatusCode'),
  requestId?: string(name='RequestId'),
  success?: boolean(name='Success'),
}

model ListGovernanceRulesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListGovernanceRulesResponseBody(name='body'),
}

/**
 * @summary 查询治理项定义信息
 *
 * @param request ListGovernanceRulesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListGovernanceRulesResponse
 */
async function listGovernanceRulesWithOptions(request: ListGovernanceRulesRequest, runtime: Util.RuntimeOptions): ListGovernanceRulesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.category)) {
    body['Category'] = request.category;
  }
  if (!Util.isUnset(request.issueType)) {
    body['IssueType'] = request.issueType;
  }
  if (!Util.isUnset(request.pageNumber)) {
    body['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    body['PageSize'] = request.pageSize;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListGovernanceRules',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 查询治理项定义信息
 *
 * @param request ListGovernanceRulesRequest
 * @return ListGovernanceRulesResponse
 */
async function listGovernanceRules(request: ListGovernanceRulesRequest): ListGovernanceRulesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGovernanceRulesWithOptions(request, runtime);
}

model ListHiveColumnLineagesRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='C-D033DD5FB82436A6'),
  columnName?: string(name='ColumnName', description='This parameter is required.', example='balance'),
  databaseName?: string(name='DatabaseName', description='This parameter is required.', example='default'),
  tableName?: string(name='TableName', description='This parameter is required.', example='test_table'),
}

model ListHiveColumnLineagesResponseBody = {
  data?: {
    downstreamLineages?: [ 
      {
        clusterId?: string(name='ClusterId', example='C-D033DD5FB82436A6'),
        columnName?: string(name='ColumnName', example='balance'),
        createTime?: string(name='CreateTime', example='2019-11-10 11:33:52'),
        databaseName?: string(name='DatabaseName', example='default'),
        directDownColumnNumber?: int32(name='DirectDownColumnNumber', example='0'),
        directDownTableNumber?: int32(name='DirectDownTableNumber', example='0'),
        directUpperColumnNumber?: int32(name='DirectUpperColumnNumber', example='1'),
        directUpperTableNumber?: int32(name='DirectUpperTableNumber', example='1'),
        modifiedTime?: string(name='ModifiedTime', example='2019-11-10 11:33:52'),
        source?: string(name='Source', example='HIVE'),
        tableName?: string(name='TableName', example='pt_table_090901_emr_child'),
      }
    ](name='DownstreamLineages'),
    downstreamNumber?: int32(name='DownstreamNumber', example='3'),
    upstreamLineages?: [ 
      {
        clusterId?: string(name='ClusterId', example='C-D033DD5FB82436A6'),
        columnName?: string(name='ColumnName', example='balance'),
        createTime?: string(name='CreateTime', example='2019-11-10 11:33:51'),
        databaseName?: string(name='DatabaseName', example='default'),
        directDownColumnNumber?: int32(name='DirectDownColumnNumber', example='1'),
        directDownTableNumber?: int32(name='DirectDownTableNumber', example='0'),
        directUpperColumnNumber?: int32(name='DirectUpperColumnNumber', example='2'),
        directUpperTableNumber?: int32(name='DirectUpperTableNumber', example='1'),
        modifiedTime?: string(name='ModifiedTime', example='2019-11-10 11:33:51'),
        source?: string(name='Source', example='HIVE'),
        tableName?: string(name='TableName', example='pt_table_090901_emr_child'),
      }
    ](name='UpstreamLineages'),
    upstreamNumber?: int32(name='UpstreamNumber', example='0'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode', example='0'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='58D5334A-B013-430E'),
}

model ListHiveColumnLineagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHiveColumnLineagesResponseBody(name='body'),
}

/**
 * @param request ListHiveColumnLineagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHiveColumnLineagesResponse
 */
async function listHiveColumnLineagesWithOptions(request: ListHiveColumnLineagesRequest, runtime: Util.RuntimeOptions): ListHiveColumnLineagesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.columnName)) {
    query['ColumnName'] = request.columnName;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListHiveColumnLineages',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListHiveColumnLineagesRequest
 * @return ListHiveColumnLineagesResponse
 */
async function listHiveColumnLineages(request: ListHiveColumnLineagesRequest): ListHiveColumnLineagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHiveColumnLineagesWithOptions(request, runtime);
}

model ListHiveTableLineagesRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='C-D033DD5FB82436A6'),
  databaseName?: string(name='DatabaseName', description='This parameter is required.', example='default'),
  tableName?: string(name='TableName', description='This parameter is required.', example='pt_table_090901_emr'),
}

model ListHiveTableLineagesResponseBody = {
  data?: {
    downstreamLineages?: [ 
      {
        clusterId?: string(name='ClusterId', example='C-D033DD5FB82436A6'),
        createTime?: string(name='CreateTime', example='2020-01-09 18:16:15'),
        databaseName?: string(name='DatabaseName', example='default'),
        engine?: string(name='Engine', example='mr'),
        jobId?: string(name='JobId', example='job_1234567055_0006'),
        modifiedTime?: string(name='ModifiedTime', example='2020-01-09 18:16:37'),
        queryText?: string(name='QueryText', example='create table parquet_example_0407 select id as one,name as two,salary as three  from PTtable_0407_emr'),
        source?: string(name='Source', example='HIVE'),
        tableName?: string(name='TableName', example='pt_table_090901_emr_orc'),
      }
    ](name='DownstreamLineages'),
    downstreamNumber?: int32(name='DownstreamNumber', example='3'),
    upstreamLineages?: [ 
      {
        clusterId?: string(name='ClusterId', example='C-D033DD5FB82436A6'),
        createTime?: string(name='CreateTime', example='2020-01-09 18:16:15'),
        databaseName?: string(name='DatabaseName', example='default'),
        engine?: string(name='Engine', example='mr'),
        jobId?: string(name='JobId', example='job_1234567055_0006'),
        modifiedTime?: string(name='ModifiedTime', example='2020-01-09 18:16:37'),
        queryText?: string(name='QueryText', example='create table parquet_example_0407 select id as one,name as two,salary as three  from PTtable_0407_emr'),
        source?: string(name='Source', example='HIVE'),
        tableName?: string(name='TableName', example='pt_table_090901_emr_orc'),
      }
    ](name='UpstreamLineages'),
    upstreamNumber?: int32(name='UpstreamNumber', example='0'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode', example='0'),
  errorMessage?: string(name='ErrorMessage', example='test'),
  requestId?: string(name='RequestId', example='691CA452-D37A-4ED0-9441'),
}

model ListHiveTableLineagesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListHiveTableLineagesResponseBody(name='body'),
}

/**
 * @param request ListHiveTableLineagesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListHiveTableLineagesResponse
 */
async function listHiveTableLineagesWithOptions(request: ListHiveTableLineagesRequest, runtime: Util.RuntimeOptions): ListHiveTableLineagesResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListHiveTableLineages',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListHiveTableLineagesRequest
 * @return ListHiveTableLineagesResponse
 */
async function listHiveTableLineages(request: ListHiveTableLineagesRequest): ListHiveTableLineagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listHiveTableLineagesWithOptions(request, runtime);
}

model ListTablePartitionsRequest {
  clusterId?: string(name='ClusterId', description='This parameter is required.', example='C-2A51D3826C701234'),
  databaseName?: string(name='DatabaseName', description='This parameter is required.', example='default'),
  order?: string(name='Order', example='ASC/DESC'),
  pageNumber?: int32(name='PageNumber', description='This parameter is required.', example='1'),
  pageSize?: int32(name='PageSize', description='This parameter is required.', example='10'),
  tableName?: string(name='TableName', description='This parameter is required.', example='test_table'),
}

model ListTablePartitionsResponseBody = {
  data?: {
    pageSize?: int32(name='PageSize', example='10'),
    pagedData?: [ 
      {
        gmtCreate?: long(name='GmtCreate', example='1568032253000'),
        gmtModified?: long(name='GmtModified', example='1568032253000'),
        location?: string(name='Location', example='hdfs://emr-header-1.cluster-136574:9000/user/hive/warehouse/pt_table_090901_emr_child/ds=20190909/hr=20/region=shanghai'),
        partitionComment?: string(name='PartitionComment', example='test'),
        partitionName?: string(name='PartitionName', example='ds=20190909/hr=20/region=shanghai'),
        partitionPath?: string(name='PartitionPath', example='hdfs://emr-header-1.cluster-136574:9000/user/hive/warehouse/pt_table_090901_emr_child/ds=20190909/hr=20/region=shanghai'),
        partitionType?: string(name='PartitionType', example='HIVE'),
      }
    ](name='PagedData'),
    totalCount?: int32(name='TotalCount', example='3'),
  }(name='Data'),
  errorCode?: string(name='ErrorCode', example='0'),
  errorMessage?: string(name='ErrorMessage', example='success'),
  requestId?: string(name='RequestId', example='UUID'),
}

model ListTablePartitionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListTablePartitionsResponseBody(name='body'),
}

/**
 * @param request ListTablePartitionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListTablePartitionsResponse
 */
async function listTablePartitionsWithOptions(request: ListTablePartitionsRequest, runtime: Util.RuntimeOptions): ListTablePartitionsResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.clusterId)) {
    query['ClusterId'] = request.clusterId;
  }
  if (!Util.isUnset(request.databaseName)) {
    query['DatabaseName'] = request.databaseName;
  }
  if (!Util.isUnset(request.order)) {
    query['Order'] = request.order;
  }
  if (!Util.isUnset(request.pageNumber)) {
    query['PageNumber'] = request.pageNumber;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tableName)) {
    query['TableName'] = request.tableName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListTablePartitions',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request ListTablePartitionsRequest
 * @return ListTablePartitionsResponse
 */
async function listTablePartitions(request: ListTablePartitionsRequest): ListTablePartitionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listTablePartitionsWithOptions(request, runtime);
}

model OpenDataWorksStandardServiceRequest {
  region?: string(name='Region', description='This parameter is required.'),
}

model OpenDataWorksStandardServiceResponseBody = {
  orderId?: string(name='OrderId'),
  requestId?: string(name='RequestId'),
}

model OpenDataWorksStandardServiceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: OpenDataWorksStandardServiceResponseBody(name='body'),
}

/**
 * @param request OpenDataWorksStandardServiceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return OpenDataWorksStandardServiceResponse
 */
async function openDataWorksStandardServiceWithOptions(request: OpenDataWorksStandardServiceRequest, runtime: Util.RuntimeOptions): OpenDataWorksStandardServiceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.region)) {
    query['Region'] = request.region;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'OpenDataWorksStandardService',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request OpenDataWorksStandardServiceRequest
 * @return OpenDataWorksStandardServiceResponse
 */
async function openDataWorksStandardService(request: OpenDataWorksStandardServiceRequest): OpenDataWorksStandardServiceResponse {
  var runtime = new Util.RuntimeOptions{};
  return openDataWorksStandardServiceWithOptions(request, runtime);
}

model SearchManualDagNodeInstanceRequest {
  dagId?: long(name='DagId', description='This parameter is required.', example='123434234'),
  projectName?: string(name='ProjectName', description='This parameter is required.', example='test_odps_project'),
}

model SearchManualDagNodeInstanceResponseBody = {
  data?: {
    nodeInsInfo?: [ 
    {
      beginRunningTime?: string(name='BeginRunningTime', example='2018-12-12 00:00:00'),
      beginWaitResTime?: string(name='BeginWaitResTime', example='2018-12-12 00:00:00'),
      beginWaitTimeTime?: string(name='BeginWaitTimeTime', example='2018-12-12 00:00:00'),
      bizdate?: string(name='Bizdate', example='2018-12-12 00:00:00'),
      createTime?: string(name='CreateTime', example='2018-12-12 00:00:00'),
      dagId?: long(name='DagId', example='12434232423'),
      dagType?: int32(name='DagType', example='5'),
      finishTime?: string(name='FinishTime', example='2018-12-12 00:00:00'),
      instanceId?: long(name='InstanceId', example='12322434112'),
      modifyTime?: string(name='ModifyTime', example='2018-12-12 00:00:00'),
      nodeName?: string(name='NodeName', example='test_node'),
      paraValue?: string(name='ParaValue', example='param_k1=param_v1'),
      status?: int32(name='Status', example='6'),
    }
  ](name='NodeInsInfo')
  }(name='Data'),
  errCode?: string(name='ErrCode', example='0'),
  errMsg?: string(name='ErrMsg', example='test'),
  requestId?: string(name='RequestId', example='2d9ced66-38ef-4923-baf6-391dd3a7e656'),
  success?: boolean(name='Success', example='true'),
}

model SearchManualDagNodeInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SearchManualDagNodeInstanceResponseBody(name='body'),
}

/**
 * @param request SearchManualDagNodeInstanceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SearchManualDagNodeInstanceResponse
 */
async function searchManualDagNodeInstanceWithOptions(request: SearchManualDagNodeInstanceRequest, runtime: Util.RuntimeOptions): SearchManualDagNodeInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.dagId)) {
    query['DagId'] = request.dagId;
  }
  if (!Util.isUnset(request.projectName)) {
    query['ProjectName'] = request.projectName;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SearchManualDagNodeInstance',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request SearchManualDagNodeInstanceRequest
 * @return SearchManualDagNodeInstanceResponse
 */
async function searchManualDagNodeInstance(request: SearchManualDagNodeInstanceRequest): SearchManualDagNodeInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return searchManualDagNodeInstanceWithOptions(request, runtime);
}

model SendTaskMetaCallbackRequest {
  code?: string(name='Code', description='This parameter is required.'),
  connectionInfo?: string(name='ConnectionInfo', description='This parameter is required.'),
  endTime?: long(name='EndTime', description='This parameter is required.'),
  resources?: [ string ](name='Resources'),
  startTime?: long(name='StartTime', description='This parameter is required.'),
  subType?: string(name='SubType', description='This parameter is required.'),
  taskEnvParam?: string(name='TaskEnvParam', description='This parameter is required.'),
  tenantId?: long(name='TenantId', description='This parameter is required.'),
  type?: string(name='Type', description='This parameter is required.'),
  user?: string(name='User'),
}

model SendTaskMetaCallbackResponseBody = {
  data?: string(name='Data'),
  errMsg?: string(name='ErrMsg'),
  errorCode?: long(name='ErrorCode'),
  requestId?: string(name='RequestId'),
}

model SendTaskMetaCallbackResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendTaskMetaCallbackResponseBody(name='body'),
}

/**
 * @param request SendTaskMetaCallbackRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SendTaskMetaCallbackResponse
 */
async function sendTaskMetaCallbackWithOptions(request: SendTaskMetaCallbackRequest, runtime: Util.RuntimeOptions): SendTaskMetaCallbackResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.code)) {
    body['Code'] = request.code;
  }
  if (!Util.isUnset(request.connectionInfo)) {
    body['ConnectionInfo'] = request.connectionInfo;
  }
  if (!Util.isUnset(request.endTime)) {
    body['EndTime'] = request.endTime;
  }
  if (!Util.isUnset(request.resources)) {
    body['Resources'] = request.resources;
  }
  if (!Util.isUnset(request.startTime)) {
    body['StartTime'] = request.startTime;
  }
  if (!Util.isUnset(request.subType)) {
    body['SubType'] = request.subType;
  }
  if (!Util.isUnset(request.taskEnvParam)) {
    body['TaskEnvParam'] = request.taskEnvParam;
  }
  if (!Util.isUnset(request.tenantId)) {
    body['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.type)) {
    body['Type'] = request.type;
  }
  if (!Util.isUnset(request.user)) {
    body['User'] = request.user;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SendTaskMetaCallback',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request SendTaskMetaCallbackRequest
 * @return SendTaskMetaCallbackResponse
 */
async function sendTaskMetaCallback(request: SendTaskMetaCallbackRequest): SendTaskMetaCallbackResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendTaskMetaCallbackWithOptions(request, runtime);
}

model SetSwitchValueRequest {
  switchName?: string(name='SwitchName'),
  switchValue?: string(name='SwitchValue'),
}

model SetSwitchValueResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
}

model SetSwitchValueResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetSwitchValueResponseBody(name='body'),
}

/**
 * @summary 设置Switch的值
 *
 * @param request SetSwitchValueRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetSwitchValueResponse
 */
async function setSwitchValueWithOptions(request: SetSwitchValueRequest, runtime: Util.RuntimeOptions): SetSwitchValueResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.switchName)) {
    query['SwitchName'] = request.switchName;
  }
  if (!Util.isUnset(request.switchValue)) {
    query['SwitchValue'] = request.switchValue;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetSwitchValue',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 设置Switch的值
 *
 * @param request SetSwitchValueRequest
 * @return SetSwitchValueResponse
 */
async function setSwitchValue(request: SetSwitchValueRequest): SetSwitchValueResponse {
  var runtime = new Util.RuntimeOptions{};
  return setSwitchValueWithOptions(request, runtime);
}

model StartCollectQualityRequest {
  callbackResultString?: string(name='CallbackResultString', description='This parameter is required.'),
}

model StartCollectQualityResponseBody = {
  requestId?: string(name='RequestId'),
  returnCode?: string(name='ReturnCode'),
  returnValue?: [ 
    {
      actualExpression?: string(name='ActualExpression'),
      bizDate?: string(name='BizDate'),
      callbackUrl?: string(name='CallbackUrl'),
      connection?: string(name='Connection'),
      entityId?: long(name='EntityId'),
      matchExpression?: string(name='MatchExpression'),
      pluginName?: string(name='PluginName'),
      strongMethodSet?: [ 
        {
          colName?: string(name='ColName'),
          isColRule?: boolean(name='IsColRule'),
          isSqlRule?: boolean(name='IsSqlRule'),
          isStrongRule?: boolean(name='IsStrongRule'),
          methodName?: string(name='MethodName'),
          ruleId?: long(name='RuleId'),
        }
      ](name='StrongMethodSet'),
      tableGuid?: string(name='TableGuid'),
      taskId?: string(name='TaskId'),
      weakMethodSet?: [ 
        {
          colName?: string(name='ColName'),
          isColRule?: boolean(name='IsColRule'),
          isSqlRule?: boolean(name='IsSqlRule'),
          isStrongRule?: boolean(name='IsStrongRule'),
          methodName?: string(name='MethodName'),
          ruleId?: long(name='RuleId'),
        }
      ](name='WeakMethodSet'),
    }
  ](name='ReturnValue'),
}

model StartCollectQualityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartCollectQualityResponseBody(name='body'),
}

/**
 * @summary startCollect
 *
 * @param request StartCollectQualityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartCollectQualityResponse
 */
async function startCollectQualityWithOptions(request: StartCollectQualityRequest, runtime: Util.RuntimeOptions): StartCollectQualityResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.callbackResultString)) {
    body['CallbackResultString'] = request.callbackResultString;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartCollectQuality',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary startCollect
 *
 * @param request StartCollectQualityRequest
 * @return StartCollectQualityResponse
 */
async function startCollectQuality(request: StartCollectQualityRequest): StartCollectQualityResponse {
  var runtime = new Util.RuntimeOptions{};
  return startCollectQualityWithOptions(request, runtime);
}

model StartDoCheckQualityRequest {
  callbackResultString?: string(name='CallbackResultString', description='This parameter is required.'),
}

model StartDoCheckQualityResponseBody = {
  requestId?: string(name='RequestId'),
  returnCode?: string(name='ReturnCode'),
  returnValue?: boolean(name='ReturnValue'),
}

model StartDoCheckQualityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartDoCheckQualityResponseBody(name='body'),
}

/**
 * @param request StartDoCheckQualityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartDoCheckQualityResponse
 */
async function startDoCheckQualityWithOptions(request: StartDoCheckQualityRequest, runtime: Util.RuntimeOptions): StartDoCheckQualityResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.callbackResultString)) {
    body['CallbackResultString'] = request.callbackResultString;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartDoCheckQuality',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request StartDoCheckQualityRequest
 * @return StartDoCheckQualityResponse
 */
async function startDoCheckQuality(request: StartDoCheckQualityRequest): StartDoCheckQualityResponse {
  var runtime = new Util.RuntimeOptions{};
  return startDoCheckQualityWithOptions(request, runtime);
}

model StartTaskQualityRequest {
  callbackResultString?: string(name='CallbackResultString', description='This parameter is required.'),
}

model StartTaskQualityResponseBody = {
  requestId?: string(name='RequestId'),
  returnCode?: string(name='ReturnCode'),
  returnValue?: {
    actualExpression?: string(name='ActualExpression'),
    bizDate?: string(name='BizDate'),
    callbackUrl?: string(name='CallbackUrl'),
    connection?: string(name='Connection'),
    entityId?: long(name='EntityId'),
    matchExpression?: string(name='MatchExpression'),
    pluginName?: string(name='PluginName'),
    statisticsFlag?: long(name='StatisticsFlag'),
    strongMethodSet?: [ 
      {
        colName?: string(name='ColName'),
        isColRule?: boolean(name='IsColRule'),
        isSqlRule?: boolean(name='IsSqlRule'),
        isStrongRule?: boolean(name='IsStrongRule'),
        methodName?: string(name='MethodName'),
        ruleId?: long(name='RuleId'),
      }
    ](name='StrongMethodSet'),
    tableGuid?: string(name='TableGuid'),
    taskId?: string(name='TaskId'),
    triggerFlag?: long(name='TriggerFlag'),
    weakMethodSet?: [ 
      {
        colName?: string(name='ColName'),
        isColRule?: boolean(name='IsColRule'),
        isSqlRule?: boolean(name='IsSqlRule'),
        isStrongRule?: boolean(name='IsStrongRule'),
        methodName?: string(name='MethodName'),
        ruleId?: long(name='RuleId'),
      }
    ](name='WeakMethodSet'),
  }(name='ReturnValue'),
}

model StartTaskQualityResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartTaskQualityResponseBody(name='body'),
}

/**
 * @param request StartTaskQualityRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return StartTaskQualityResponse
 */
async function startTaskQualityWithOptions(request: StartTaskQualityRequest, runtime: Util.RuntimeOptions): StartTaskQualityResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.callbackResultString)) {
    body['CallbackResultString'] = request.callbackResultString;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'StartTaskQuality',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @param request StartTaskQualityRequest
 * @return StartTaskQualityResponse
 */
async function startTaskQuality(request: StartTaskQualityRequest): StartTaskQualityResponse {
  var runtime = new Util.RuntimeOptions{};
  return startTaskQualityWithOptions(request, runtime);
}

model TriggerDataLoaderResponseBody = {
  data?: boolean(name='Data'),
  requestId?: string(name='RequestId'),
}

model TriggerDataLoaderResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TriggerDataLoaderResponseBody(name='body'),
}

/**
 * @summary 触发元数据的Merge操作
 *
 * @param request TriggerDataLoaderRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TriggerDataLoaderResponse
 */
async function triggerDataLoaderWithOptions(runtime: Util.RuntimeOptions): TriggerDataLoaderResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'TriggerDataLoader',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 触发元数据的Merge操作
 *
 * @return TriggerDataLoaderResponse
 */
async function triggerDataLoader(): TriggerDataLoaderResponse {
  var runtime = new Util.RuntimeOptions{};
  return triggerDataLoaderWithOptions(runtime);
}

model TriggerTimeMachineTaskResponseBody = {
  data?: {
    gmtCreate?: string(name='GmtCreate'),
    gmtModified?: string(name='GmtModified'),
    hostName?: string(name='HostName'),
    id?: string(name='Id'),
    objId?: string(name='ObjId'),
    objName?: string(name='ObjName'),
    operType?: string(name='OperType'),
    status?: string(name='Status'),
  }(name='Data'),
  errCode?: string(name='ErrCode'),
  errMsg?: string(name='ErrMsg'),
  requestId?: string(name='RequestId'),
}

model TriggerTimeMachineTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TriggerTimeMachineTaskResponseBody(name='body'),
}

/**
 * @summary 触发timeMachine任务
 *
 * @param request TriggerTimeMachineTaskRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TriggerTimeMachineTaskResponse
 */
async function triggerTimeMachineTaskWithOptions(runtime: Util.RuntimeOptions): TriggerTimeMachineTaskResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'TriggerTimeMachineTask',
    version = '2018-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
 * @summary 触发timeMachine任务
 *
 * @return TriggerTimeMachineTaskResponse
 */
async function triggerTimeMachineTask(): TriggerTimeMachineTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return triggerTimeMachineTaskWithOptions(runtime);
}

